from Base.base import Base
from selenium.webdriver.common.by import By
from utils.data_header import read_yaml
import os

class Page6(Base):
    # 获取定位信息
    current_dir = os.path.dirname(__file__)
    test_case = read_yaml(os.path.join(current_dir, '..', 'Config', 'endpoints.yaml'))
    case = test_case[5]

    manage_loc=(By.XPATH,case['manage_loc'])

    def manage(self):
        self.click(self.manage_loc)

    peizhi_loc=(By.XPATH,case['peizhi_loc'])

    def peizhi(self):
        self.click(self.peizhi_loc)

    bangdin_loc=(By.XPATH,case['bangdin_loc'])

    def bangdin(self):
        self.click(self.bangdin_loc)

    userhao_loc=(By.NAME,case['userhao_loc'])

    def userhao(self):
        self.send_keys(self.userhao_loc,'819508969702914')

    username_loc=(By.XPATH,case['username_loc'])

    def username(self):
        self.send_keys(self.username_loc,'何八')

    bankname_loc=(By.ID,case['bankname_loc'])

    def bankname(self):
        self.select(self.bankname_loc,'中国民生银行')

    banktype_loc=(By.ID,case['banktype_loc'])

    def banktype(self):
        self.select(self.banktype_loc,'对私借记卡')

    AccountName_loc=(By.NAME,case['AccountName_loc'])

    def account(self):
        self.send_keys(self.AccountName_loc,'何八')

    bankhao_loc=(By.NAME,case['bankhao_loc'])

    def bankhao(self):
        self.send_keys(self.bankhao_loc,'4874684649')

    cardType_loc=(By.ID,case['cardType_loc'])

    def cardtype(self):
        self.send_keys(self.cardType_loc,'身份证')

    cardhao_loc=(By.NAME,case['cardhao_loc'])

    def cardhao(self):
        self.send_keys(self.cardhao_loc,'234985456849630725')

    mobile_loc=(By.NAME,case['mobile_loc'])

    def mobile(self):
        self.send_keys(self.mobile_loc,'16484638749')

    address_loc=(By.NAME,case['address_loc'])

    def address(self):
        self.send_keys(self.address_loc,'北京市北京市东城区天安门广场')

    commit_loc=(By.XPATH,case['commit_loc'])

    def commit(self):
        self.click(self.commit_loc)


